<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<title>Develop and Test on JasminCC</title>
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"\@SimSun";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"Agfa Rotis Sans Serif";
	panose-1:0 0 4 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Develop
and Test on JasminCC</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>MappedLexer</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>JasminCC
is based on JavaCC, only adds Object-Oriented features to the proven parser
generator engine. Most of the grammar syntax are not touched, by doing so,
JasminCC develop a lexer as his sub-project, whose purpose is to modify the
necessary grammar of the token stream, and left the remaining unchanged to be
processed by the JavaCC.</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>&nbsp;</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Productions
and Spring Framework</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>By
employing IoC way, JasminCC makes the production parsing units are independent
of each other. </span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#0000C0;background:blue'>tk</span><span style='font-size:10.0pt;
font-family:"Courier New";color:black;background:blue'> = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0;background:
blue'>lexer</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:blue'>.nexttok(</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#2A00FF;background:blue'>&quot;,&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black;background:blue'>,
</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;
background:blue'>&quot;:&quot;</span><span style='font-size:10.0pt;font-family:
"Courier New";color:black;background:blue'>, </span><span style='font-size:
10.0pt;font-family:"Courier New";color:#2A00FF;background:blue'>&quot;#&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black;background:blue'>);</span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>Skipping</span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#0000C0;background:blue'>tk</span><span style='font-size:10.0pt;
font-family:"Courier New";color:black;background:blue'> = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0;background:
blue'>lexer</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:blue'>.skipTo(</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#2A00FF;background:blue'>'('</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black;background:blue'>);</span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>Which used to skip the argument definition in a method.</span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#0000C0;background:blue'>tk</span><span style='font-size:10.0pt;
font-family:"Courier New";color:black;background:blue'> = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0;background:
blue'>lexer</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:blue'>.skip(</span><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#7F0055;background:blue'>true</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black;background:blue'>,
</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF;
background:blue'>'{'</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:blue'>);</span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>Ignores the java code in a JavaCC method and left it to JavaCC</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>&nbsp;</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Testing</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Every
production implements Production interface, and connects other associated
productions in the form of a strategy design pattern, this makes the
productions are highly testable, all the collaborated productions can be mocked
easily. Once the production passes the testing, combining with the parser is
easily done with adding it to the Spring Framework bean factory file.</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>&nbsp;</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Extensiblity</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>In
the very beginning of the development of JasminCC, we expect there will be frequent
change on the library. Extending a hand written parser would be a challenge
task if the production parsing units are highly depends on each other. Spring
Framework grants a helping hand here, the new production parsing unit just need
to be tested on its own grammar requirement and swap with the previous workable
unit in Spring Framework file is enough. </span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>&nbsp;</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Sam
Huang</span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Agfa Rotis Sans Serif"'>Accenture
Guangzhou</span></p>

</div>

</body>

</html>
